// pages/me/pages/appeal/appealStart.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    type: [],
    fileList: []
  },

  /**
   * 组件的方法列表
   */
  methods: {

    beforeRead(event) {
      const {
        file,
        callback
      } = event.detail;
      callback(file.type === 'image');
      const {
        fileList = []
      } = this.data;
      fileList.push({
        ...file,
        url: file.url
      });
      this.setData({
        fileList
      });
      // console.log("-------------",file);
    },
    deletePic: function (e) {
      console.log("-----------", e);
    },
    afterRead: function () {

    },
    onclicktype: function (e) {
      let index = e.currentTarget.dataset.index;
      var arr = this.data.type;
      var c = arr.indexOf(index);
      if (c > 0) {

        arr.splice(c, 1);
      } else {
        arr.push(index);
      }
      this.setData({
        type: arr,
      })
      console.log("------------", index, arr);
    }
  }
})